#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>


#ifdef __WINDOWS_FFS__
	#include <windows.h>
#endif
#include <usb.h>        /* this is libusb */
#include "opendevice.h" /* common code moved to separate module */ 

#include "../requests.h"   /* custom request numbers */
#include "../usbconfig.h"  /* device's VID/PID and names */

#define SAMPLE_COUNT 280
#define DEFAULT_PRESCALE 4

int usbMsg(
    usb_dev_handle* handle, char* buffer, size_t buflen,
    int request, int endpoint, int wval);
usb_dev_handle* connect_device();
	
void nsleep(long nanoseconds);
FILE* newDatafile();
int grabData(usb_dev_handle* handle, char* buffer);